package jdwl.hrmgrsys.pojo.core;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import jdwl.hrmgrsys.pojo.Enterprise;

import org.springframework.stereotype.Service;

/**
 * 用于管理部门，职位，等参数信息，跟企业属于1对多关系
 * @author Huangdian
 *
 */
@Entity
@Table(name="comm_para")
@Service
public class CommonPara implements Serializable{
	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue
	@Column(name="id")
	private Long id;
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public ParaType getType() {
		return type;
	}
	public void setType(ParaType type) {
		this.type = type;
	}
	
	public Enterprise getEnterprise() {
		return enterprise;
	}
	public void setEnterprise(Enterprise enterprise) {
		this.enterprise = enterprise;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	@ManyToOne(cascade=CascadeType.PERSIST,targetEntity=ParaType.class,fetch=FetchType.EAGER)
	private ParaType type;//类型
	@ManyToOne(cascade=CascadeType.PERSIST,targetEntity=Enterprise.class,fetch=FetchType.LAZY)
	private Enterprise enterprise;
	private String desc;//描述,界面展示
	private String code;//编码
	
}
